<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>抢课系统</title>
	<link rel="stylesheet" href="Css/bootstrap.min.css">
	<link rel="stylesheet" href="Css/login.css">
</head>
<body>
	<div class="container">
	<div class="row clearfix" id="header">
			<div class="col-md-12 column">
				<h3 class="text-center">
					川大学生抢课系统
				</h3>
			</div>
		</div>
		<div class="row clearfix">
			<div class="col-md-4 column">
			<p>技术交流群：428174328</p>
			<p>欢迎您的加入！</p>
			<a target="_blank" href="http://shang.qq.com/wpa/qunwpa?idkey=1b8ad9e0845f017c83004cb4cbdd50d6cc397e6784b97328cb1e15d5a39dfb8b"><img border="0" src="http://pub.idqqimg.com/wpa/images/group.png" alt="川大抢课技术交流" title="川大抢课技术交流"></a>
			<br/>
			<img src="erweima.png" style="width:200px" alt="erweima.png" />
			</div>
			<div class="col-md-4 column">
				<form class="form-horizontal" role="form" id="form-login" enctype="application/json">
					<div class="form-group">
						<label for="studentnumber" class="col-sm-2 control-label">学号</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" id="studentnumber" name="studentnumber" />
						</div>
					</div>
					<div class="form-group">
						<label for="password" class="col-sm-2 control-label">密码</label>
						<div class="col-sm-10">
							<input type="password" class="form-control" id="password" name="password" />
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-offset-2 col-sm-10">
							<button type="button" class="btn btn-default" id="btn-login">登录</button>
						</div>
					</div>
				</form>
			</div>
			<div class="col-md-4 column">
			
			<a class="btn btn-success" href="api/index.html" style="margin:10px 0 10px 40px;width:150px">开发者入口</a><br />
			<p style="margin-left:40px">第三方接口，详情猛戳☝☝☝</p>
			</div>
		</div>
	</div>

	<script src="Js/jquery.min.js"></script>
	<script src="Js/bootstrap.min.js"></script>
	<script src="Js/jquery.json.min.js"></script>

	<script>
	$(document).ready(function() {
		$.ajaxSetup({ contentType: 'application/json' }); 
		$('#btn-login').click(function() {
			/* Act on the event */
			$studentnumber	=	$('#studentnumber').val();
			$password	=	$('#password').val();
			if(!$studentnumber){
				alert('请输入用户名！');
				return;
			}
			if(!$password){
				alert('请输入密码！');
				return;
			}
			 
			$param = {"studentnumber":$studentnumber,"password":$password};
			$param1 = $.toJSON($param);
			console.log($param1);
			$action = "/scucource/scucorse/core/user";
			$.post($action, $param1, function(data) {
				/*optional stuff to do after success */
				//console.log(data);return;
				if(data.content == 1){
					url = "/scucource/tasks.html";
					window.location.href = url;
				}else{
					alert('登录失败！');
				}
			},'json');
		});
	});
	</script>
</body>
</html>